package com.axjy.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.axjy.mapper.GuaHaoMapper;
import com.axjy.pojo.GuaHao;
import com.axjy.service.GuaHaoService;
import com.axjy.util.Pager;

@Transactional
@Service("GuaHaoService")
public class GuaHaoServiceImpl implements GuaHaoService{

	@Resource
	private GuaHaoMapper guaHaoMapper;
	
	@Override
	public int addGuaHao(GuaHao guahao) {
		return guaHaoMapper.addGuaHao(guahao);
	}

	@Transactional(readOnly=true)
	@Override
	public Pager pager(Integer offset, Integer limit, String columnName, String columnValue) {
		Pager pager=new Pager();
		pager.setRows(guaHaoMapper.list(offset, limit, columnName, columnValue));
		pager.setTotal(guaHaoMapper.getTotal(columnName, columnValue));
		return pager;
	}
	
}
